package es.xpt.ysf.utils;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectStreamClass;

import org.apache.myfaces.shared_tomahawk.util.ClassUtils;
import org.jboss.serial.io.JBossObjectInputStream;

public class MyFacesJBossObjectInputStream extends JBossObjectInputStream {

        public MyFacesJBossObjectInputStream(InputStream stream) throws IOException {
                super(stream);
        }

    protected Class<?> resolveClass(ObjectStreamClass desc)throws ClassNotFoundException, IOException{
        
            try{
                return ClassUtils.classForName(desc.getName());
            }
            catch (ClassNotFoundException e){
                return super.resolveClass(desc);
            }
    }
        
}

